import React, {Component} from 'react';
import { KgWrapper } from "../style";
import { connect } from 'react-redux';


class AnswerFromKg extends Component{
  render() {
    const { answer , question } = this.props;
    return (
      <KgWrapper>
        <span className={'title'}>以下内容来源于知识库</span>
        <br/>
        <span className={'question'}>问：{question.length==0?'无':question}</span>
        <br/>
        <span className={'answer'}>答：{answer}</span>
      </KgWrapper>
    );
  }
}
const mapStateToProps = (state) => {
  return {
    answer: state.get('search').get('answer'),
    question: state.get('search').get('InputValue'),
  }
}
export default connect(mapStateToProps,null)(AnswerFromKg)
